import request from '@/utils/request'

export default {
  getList: function (params) {
    return request({
      url: '/sysUser/listByPage',
      method: 'post',
      data: params
    })
  },
  saveUser: function (params) {
    let url='register'
    if(params.id){
      url = 'update'
    }
    return request({
      url: '/sysUser/'+ url,
      method: 'post',
      data: params
    })
  },
  remove: function (roleId) {
    return request({
      url: '/sysUser/delete/'+roleId,
      method: 'get',
    })
  },
  resetPassword: function (id) {
    return request({
      url: '/sysUser/resetPassword/'+id,
      method: 'get'
    })
  },
  setRole: function (params) {
    return request({
      url: '/sysUser/setRole',
      method: 'post',
      data:params
    })
  },
  changeStatus: function (id) {
    return request({
      url: '/sysUser/changeStatus/'+id,
      method: 'get'
    })
  }
}
